package org.example.rocketmq;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.example.constant.CommonConstant;
import org.example.model.User;
import org.springframework.stereotype.Component;

/**
 * @Description:
 * @Auther: wangyaomeng
 * @Date: 2021/1/22 17:37
 * @param:
 */
@Component
@RocketMQMessageListener(topic = CommonConstant.STUDY_PRODUCER_TOPIC,
        consumerGroup = CommonConstant.CONSUMER_GROUP,
        selectorExpression = CommonConstant.SYNC_TAG )
public class StudyConsumer implements RocketMQListener<User> {
    @Override
    public void onMessage(User user) {
        System.out.println("同步消费消息:"+user);
    }
}
